﻿<Application x:Class="DBLint.DBLintGui.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Startup="Application_Startup"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <Style TargetType="{x:Type HeaderedContentControl}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type HeaderedContentControl}">
                        <Grid Grid.IsSharedSizeScope="False" Width="Auto" HorizontalAlignment="Stretch">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition SharedSizeGroup="A" Width="Auto"/>
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Label IsTabStop="False" Grid.Column="0" Content="{TemplateBinding Header}" />
                            <TextBox  Grid.Column="1" Text="{Binding Path=Content, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="IsTabStop"  Value="False"/>
        </Style>

        <Style TargetType="{x:Type HeaderedContentControl}" x:Key="contentStyle">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type HeaderedContentControl}">
                        <Grid Grid.IsSharedSizeScope="False" Width="Auto" HorizontalAlignment="Stretch">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition SharedSizeGroup="A" Width="Auto"/>
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Label IsTabStop="False" Grid.Column="0" Content="{TemplateBinding Header}" />
                            <ContentPresenter Grid.Column="1" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="IsTabStop"  Value="False"/>
        </Style>


        <!-- Begin control template for checkbox without animation -->

        <LinearGradientBrush x:Key="NormalBrush" StartPoint="0,0" EndPoint="0,1">
            <GradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="#FFF" Offset="0.0"/>
                    <GradientStop Color="#CCC" Offset="1.0"/>
                </GradientStopCollection>
            </GradientBrush.GradientStops>
        </LinearGradientBrush>

        <LinearGradientBrush x:Key="DarkBrush" StartPoint="0,0" EndPoint="0,1">
            <GradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="#FFF" Offset="0.0"/>
                    <GradientStop Color="#AAA" Offset="1.0"/>
                </GradientStopCollection>
            </GradientBrush.GradientStops>
        </LinearGradientBrush>

        <LinearGradientBrush x:Key="PressedBrush" StartPoint="0,0" EndPoint="0,1">
            <GradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="#BBB" Offset="0.0"/>
                    <GradientStop Color="#EEE" Offset="0.1"/>
                    <GradientStop Color="#EEE" Offset="0.9"/>
                    <GradientStop Color="#FFF" Offset="1.0"/>
                </GradientStopCollection>
            </GradientBrush.GradientStops>
        </LinearGradientBrush>

        <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />

        <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" />


        <!-- Border Brushes -->

        <LinearGradientBrush x:Key="NormalBorderBrush" StartPoint="0,0" EndPoint="0,1">
            <GradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="#CCC" Offset="0.0"/>
                    <GradientStop Color="#444" Offset="1.0"/>
                </GradientStopCollection>
            </GradientBrush.GradientStops>
        </LinearGradientBrush>

        <LinearGradientBrush x:Key="PressedBorderBrush" StartPoint="0,0" EndPoint="0,1">
            <GradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="#444" Offset="0.0"/>
                    <GradientStop Color="#888" Offset="1.0"/>
                </GradientStopCollection>
            </GradientBrush.GradientStops>
        </LinearGradientBrush>

        <SolidColorBrush x:Key="DisabledBorderBrush" Color="#AAA" />

        <!-- Miscellaneous Brushes -->
        <SolidColorBrush x:Key="GlyphBrush" Color="#444" />

        <ControlTemplate TargetType="CheckBox" x:Key="noAnimationControlTemplate">
            <BulletDecorator Background="Transparent">
                <BulletDecorator.Bullet>
                    <Border x:Name="Border" Width="13" Height="13" CornerRadius="0"
                                                        Background="{StaticResource NormalBrush}" 
                                                        BorderThickness="1"
                                                        BorderBrush="{StaticResource NormalBorderBrush}">
                        <Path Width="7" Height="7" 
                                                          x:Name="CheckMark"
                                                          SnapsToDevicePixels="False"
                                                          Stroke="{StaticResource GlyphBrush}"
                                                          StrokeThickness="2"
                                                          Data="M 0 0 L 7 7 M 0 7 L 7 0" />
                    </Border>
                </BulletDecorator.Bullet>
                <ContentPresenter Margin="4,0,0,0"
                                                              VerticalAlignment="Center"
                                                              HorizontalAlignment="Left" 
                                                              RecognizesAccessKey="False"/>
            </BulletDecorator>
            <ControlTemplate.Triggers>
                <Trigger Property="IsChecked" Value="false">
                    <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                </Trigger>
                <Trigger Property="IsChecked" Value="{x:Null}">
                    <Setter TargetName="CheckMark" Property="Data" Value="M 0 7 L 7 0" />
                </Trigger>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource DarkBrush}" />
                </Trigger>
                <Trigger Property="IsPressed" Value="true">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
                    <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                    <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                    <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <!-- end control template for checkbox without animation -->


    </Application.Resources>
</Application>
